package com.ruoyi.project.mydy.payaccount.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.payaccount.mapper.DlPayAccountMapper;
import com.ruoyi.project.mydy.payaccount.domain.DlPayAccount;
import com.ruoyi.project.mydy.payaccount.service.IDlPayAccountService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 个人账户Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlPayAccountServiceImpl implements IDlPayAccountService 
{
    @Autowired
    private DlPayAccountMapper dlPayAccountMapper;

    /**
     * 查询个人账户
     * 
     * @param id 个人账户主键
     * @return 个人账户
     */
    @Override
    public DlPayAccount selectDlPayAccountById(Long id)
    {
        return dlPayAccountMapper.selectDlPayAccountById(id);
    }

    /**
     * 查询个人账户列表
     * 
     * @param dlPayAccount 个人账户
     * @return 个人账户
     */
    @Override
    public List<DlPayAccount> selectDlPayAccountList(DlPayAccount dlPayAccount)
    {
        return dlPayAccountMapper.selectDlPayAccountList(dlPayAccount);
    }

    /**
     * 新增个人账户
     * 
     * @param dlPayAccount 个人账户
     * @return 结果
     */
    @Override
    public int insertDlPayAccount(DlPayAccount dlPayAccount)
    {
        dlPayAccount.setCreateTime(DateUtils.getNowDate());
        return dlPayAccountMapper.insertDlPayAccount(dlPayAccount);
    }

    /**
     * 修改个人账户
     * 
     * @param dlPayAccount 个人账户
     * @return 结果
     */
    @Override
    public int updateDlPayAccount(DlPayAccount dlPayAccount)
    {
        return dlPayAccountMapper.updateDlPayAccount(dlPayAccount);
    }

    /**
     * 批量删除个人账户
     * 
     * @param ids 需要删除的个人账户主键
     * @return 结果
     */
    @Override
    public int deleteDlPayAccountByIds(String ids)
    {
        return dlPayAccountMapper.deleteDlPayAccountByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除个人账户信息
     * 
     * @param id 个人账户主键
     * @return 结果
     */
    @Override
    public int deleteDlPayAccountById(Long id)
    {
        return dlPayAccountMapper.deleteDlPayAccountById(id);
    }
}
